<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript" src="../js/react.development.js" ></script>
    <script type="text/javascript" src="../js/react-dom.development.js" ></script>
    <script type="text/javascript" src="../js/babel.min.js" ></script>
    <style>
        .title{
            background-color: orange;
            width:500px;
        }
    </style>
</head>
<body>
    <div id="test"></div>
    <script type="text/babel">
        // 创建类式组件
        // 要求必须继承React.Component这个类
        class MyComponent extends React.Component {
            render(){
                return (
                    <div>
                        <h1 className="title">
                            <span style={{color:'white'}}>zzzzzzz</span>
                        </h1>
                    </div>
                )
            }
        }
        // 渲染
        ReactDOM.render(<MyComponent/>,document.getElementById('test'))
        // 过程是
        // 1，找标签，找组件
        // 2. 组件是类，new一个实例，调用render方法
        // 3. 把返回的虚拟dom渲染后，塞到真实dom里
    </script>
</body>
</html>